pkg_name=iproute2
version=3.19.0
src_dir=$src_dir_root/$pkg_name-$version
url=https://www.kernel.org/pub/linux/utils/net/$pkg_name/$pkg_name-$version.tar.xz

cd "$src_dir_root"
rm -Rf "$pkg_name-$version"
tar Jxf "$pkg_name-$version.tar.xz"

cd "$src_dir"

#arpd daemon fails to compile
sed -i '/TARGETS/ s/arpd //' misc/Makefile
#custom configure script hardcoded on bash...
sed -i 's:/bin/bash:/bin/sh:' configure
#again... bash hardcoded
sed -i 's/SHELL=bash/SHELL=sh/' doc/Makefile

./configure

install_tmp_dir=/tmp/$pkg_name-$version
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"

make install					\
	"DESTDIR=$install_tmp_dir"		\
	"CCOPTS=-O0" PREFIX= SBINDIR=/bin

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/runtime.links"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

rm -Rf "$install_tmp_dir"
rm -Rf "$src_dir"
